#ifndef FVI_H
#define FVI_H

#include <opencv2\opencv.hpp>
#include <cuda.h>
#include <cuda_runtime.h>

class Projection_GPU;
class Visualizer;
class ApplyRigidTransform;
class DimensionConvertor;
class SingleKinect;
class FrameAccumulation;
class ClusterHandler;

class PlaneFitting_FVI{
public:
	PlaneFitting_FVI();
	~PlaneFitting_FVI();
	void						PlaneFitting();
	void						CreateFVI(const cv::Mat_<cv::Vec3b>* color_image, const cv::Mat_<int>* cluster_id);
	const float3*				GetPlaneFitted_Host()const;
	const float3*				GetFiltered_Host()const;
	const cv::Mat_<cv::Vec3b>	GetColorImage()const;
	const cv::Mat_<int>			GetClusterLabel()const;
	void						releaseVideo();
private:
	SingleKinect*				Single_Kinect;
	ClusterHandler*				Clusterhandler;
	Projection_GPU*				Plane_Projector;
	Visualizer*					Visual;
	ApplyRigidTransform*		ChangeViewpoint;
	DimensionConvertor*			Convert2D3D;
	float3*						Projected3D_Host;
	float*						Rotation;
	float*						Translation;
	float*						Depth_Host;               
	float*						Depth_Device;      
	float3*						Points3D_Host;				
	float3*						Points3D_Device;			
	float3*						FreeViewpoint2D_Device;
	float3*						FreeViewpoint2D_Host;
	int*						FreeViewpointClusterID_Host;
	cv::Mat_<double>			PlaneFittedDepth;
	cv::Mat_<cv::Vec3b>			FreeViewpointImage;
	cv::Mat_<double>			FreeViewpointDepth;
	cv::Mat_<cv::Vec3b>			FreeViewpointImage_Input;
	cv::Mat_<double>			FreeViewpointDepth_Input;
	float						angle_ydeg;
	float						angle_delta;
	float						trans_x;
};

#endif